Qlik Community

QlikView App Dev

Discussion Board for collaboration related to QlikView App Development.

Announcements
Support Case Portal has moved to Qlik Community! Read the FAQs to start exploring Support resources.
cancel
Showing results for 
Search instead for 
Did you mean: 
gireesh1216
Creator II
Creator II

How to assign zero value in second refresh

Hello Team,

Below is the script.Qlikview app first refresh vSuccess should show 1 and second refresh vSuccess should show zero.

How to achieve this ?

Let vTest='A';

If  vTest='A' then

Let vSuccess=1;

Else

Set vSuccess='False';

end if

Exit Script;

Output:

1.QlikView First Refresh vSuccess=1 (Return 1 value)

2..QlikView second Refresh vSuccess=0 (vSucess should show zero)

 

 

 

 

Thanks,

Gireesh

Labels (2)
1 Solution

Accepted Solutions
sunny_talwar

Try this

If MonthStart(Today()) = If(Len(Trim(vLastReloadDate)) > 0, vLastReloadDate, 0) THEN
	
	LET vSuccess = 0;
	
ELSE 
	
	LET vSuccess = 1;
	
ENDIF;

TRACE $(vSuccess);

LET vLastReloadDate = Num(MonthStart(Today(1)));

View solution in original post

9 Replies
sunny_talwar

How about the third refresh? or the first refresh of the hour or day or month or year is set to 1 and then every subsequent ones are set to 0?

gireesh1216
Creator II
Creator II
Author

Need 1 only for first refresh and other subsequent refresh it should return 0.

sunny_talwar

1st refresh ever or 1st refresh of the day or 1st refresh of the month?

gireesh1216
Creator II
Creator II
Author

Spoiler
Spoiler
1st refresh of every month
sunny_talwar

Try this

If MonthStart(Today()) = If(Len(Trim(vLastReloadDate)) > 0, vLastReloadDate, 0) THEN
	
	LET vSuccess = 0;
	
ELSE 
	
	LET vSuccess = 1;
	
ENDIF;

TRACE $(vSuccess);

LET vLastReloadDate = Num(MonthStart(Today(1)));

View solution in original post

gireesh1216
Creator II
Creator II
Author

Below condition is failing at first time because of variable(vLastReloadDate) not found.

 

If MonthStart(Today()) = If(Len(Trim(vLastReloadDate)) > 0, vLastReloadDate, 0) THEN

sunny_talwar

To handle the no value within vLastReloadData, I am using Len(Trim())... I tried it before sending the code and it worked for me. Can you share a sample where this isn't working? or share screenshot where we can see that this doesn't work.

gireesh1216
Creator II
Creator II
Author

Its Working fine.Thank you so much 🙂

sunny_talwar

Awesome, I am glad it worked now. Please close the thread by marking a solution.

Best,
Sunny