Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Only at Qlik Connect! Guest keynote Jesse Cole shares his secrets for daring to be different. Learn More!
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Using Flags in Load Script

Hi guys,

I have searched the forum looking for posts relating to using flags in Load script to simplify expressions in charts. Oleg had a post, but the link to the post does not work anymore. Can someone please provide a very basic, simple and clear example of how to use these flags as I am unsure of how to do it?

Thank you

4 Replies
kaushiknsolanki
Partner Ambassador/MVP
Partner Ambassador/MVP

Hi,

    You can use variables in scripts which can act like a flag.

    Will you please explain what you want to achieve using flags.

Thanks & Regards,

Kaushik Solanki  

Please remember to hit the 'Like' button and for helpful answers and resolutions, click on the 'Accept As Solution' button. Cheers!
Not applicable
Author

I m trying to do something like this as an expression,

count ({<Strat1 ={'1'}, app_date = strat_date>}distinct customer_id)


but from my understanding, in set analysis you can't compare two fields together, as the app_date and the strat_date are both fields in my application. I have been advised to try and use flags in the load script to handle this, so any thoughts on this or any other way of re-writing this expression to get it to satisfy those conditions would be appreciated.

Thanks

nagaiank
Specialist III
Specialist III

Though I do not know the requirements of your application nor what you are trying to do, I can answer a part of your question.

When you were advised to try the use of flag, probably s(he) meant this:

(1) In the logical table having the fields app_date and strat_date, add a field (let us call it 'date_flag') which is true when the dates are equal. (You can do this by adding (app_date = strat_date) as date_flag in your load script.

(2) Use this flag in your set analysis expression instead of comparing dates (e.g. count ({<Strat1 ={'1'}, date_flag = {'true'}>}distinct customer_id)

Hope this helps.

Not applicable
Author

Thanks for your reply krishnamoorthy. I will try it out and let you know how it goes