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

Announcements
Qlik GA: Multivariate Time Series in Qlik Predict: Get Details
cancel
Showing results for 
Search instead for 
Did you mean: 
rcandeo
Creator III
Creator III

How is the correct syntax?

Hi, I need to make this expression in my dinamic table and I'm not finding the right way:

sum (if(weekday(yesterday)='sun',{1<Date={'$(DateYesterday2)'}, Company={'ADBR'}>}, {1<Date={'$(DateYesterday1)'}, Company={'ADBR'}>} Quantity)

Anyone can give me a hint?

This expression works:

sum ({1<Date={'$(DateYesterday2)'}, Company={'ADBR'}>} Quantity)

Thanks

1 Solution

Accepted Solutions
Not applicable

You can also just put 2 seperate expression using the if:

if(weekday(yesterday)='sun',

sum ({1<Date={'$(DateYesterday2)'}, Company={'ADBR'}>} Quantity),

sum({1<Date={'$(DateYesterday1)'}, Company={'ADBR'}>}Quantity))

Or you can just create one variable that uses the same if statement:

DateYesterday=if(weekday(yesterday)='sun','Expression','Expression2')

Then do:

sum({1<Date={'$(DateYesterday)'}, Company={'ADBR'}>}Quantity))

View solution in original post

4 Replies
Not applicable

It doesn't appear to be working that way on my end either, a possible workaround might be to define two variables

var1 = sum ({1<Date={'$(DateYesterday2)'}, Company={'ADBR'}>} Quantity)

var2 = sum ({1<Date={'$(DateYesterday1)'}, Company={'ADBR'}>} Quantity)

Then you can just do if(weekday(yesterday)='sun',var1, var2) in your table.

Hope this helps.

Not applicable

You can also just put 2 seperate expression using the if:

if(weekday(yesterday)='sun',

sum ({1<Date={'$(DateYesterday2)'}, Company={'ADBR'}>} Quantity),

sum({1<Date={'$(DateYesterday1)'}, Company={'ADBR'}>}Quantity))

Or you can just create one variable that uses the same if statement:

DateYesterday=if(weekday(yesterday)='sun','Expression','Expression2')

Then do:

sum({1<Date={'$(DateYesterday)'}, Company={'ADBR'}>}Quantity))

CELAMBARASAN
Partner - Champion
Partner - Champion

Hi,

Check with this

if(weekday(yesterday)='sun',sum ({1<Date={'$(DateYesterday2)'}, Company={'ADBR'}>} Quantity), Sum({1<Date={'$(DateYesterday1)'}, Company={'ADBR'}>} Quantity))

Celambarasan

jagan
Partner - Champion III
Partner - Champion III

Hi,

Qlikview is case sensitive, so 'sun' should be 'Sun', and your expression should be like below

= if(WeekDay(yesterday)='Sun', Sum ({1<Date={'$(DateYesterday2)'}, Company={'ADBR'}>} Quantity), Sum({1<Date={'$(DateYesterday1)'}, Company={'ADBR'}>} Quantity))

Regards,

Jagan.