Skip to main content
Announcements
See why Qlik is a Leader in the 2024 Gartner® Magic Quadrant™ for Analytics & BI Platforms. Download Now
cancel
Showing results for 
Search instead for 
Did you mean: 
mayuranp
Creator
Creator

In Qlikview, Find no of stores that have achieved the budget

In Qlikview, I am trying to get no of stores that have achieved budget for this year to date.

I run the report every day morning for the year upto end of yesterday.

The expression below is not working due to double quotes within double quotes.

I tried replacing inner double quotes with single quotes but no luck.

Any suggestions / ideas?

count({<StoreNo={"=sum( {<DayNo={"<=$(vYesterday_DayNo)"}>}SalesAmount)> sum( {<FYea
6 Replies
Anil_Babu_Samineni

Single Quote should work, May be share full expression?

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
mayuranp
Creator
Creator
Author

This is full expression

=count({<StoreNo={"=sum( {<SalesEntryType={'Sales'},FYear={$(vYesterday_Year)},FPeriod={$(vYesterday_PeriodNo)},DayNo={<=$(vYesterday_DayNo)}>}SalesAmount)<

sum( {<FYear={$(vYesterday_Year)},FPeriod={$(vYesterday_PeriodNo)},DayNo={'<=$(vYesterday_DayNo)'}>}[Budget Amount])"}>}StoreNo)

Returns 0 always

mayuranp
Creator
Creator
Author

I create the variables in script and then use them in chart expressions.

When I write the full expression in the chart, it works as you mentioned. However, storing the the expression in the variable for this is not working.

Anyway, I have a workaround now.

Here is the full expression that works in the chart:

=count({<StoreNo={"=sum( {<SalesEntryType={'Sales'},FYear={$(vYesterday_Year)},FPeriod={$(vYesterday_PeriodNo)},FYearName,Date,DayNo={'<=$(vYesterday_DayNo)'}>}SalesAmount)>

sum( {<[Gen Prod Posting Group Code],[Misc Brands],[Dont Show on Analysis Screen],[Hour],FYear={$(vYesterday_Year)},FPeriod={$(vYesterday_PeriodNo)},FYearName,Date,DayNo={'<=$(vYesterday_DayNo)'}>}[Budget Amount])"}>}StoreNo)

Can this be stored as a variable in script?

Thanks.

Kushal_Chawda

you can user single quote in inner set

count({<StoreNo={"=sum( {<DayNo={'<=$(vYesterday_DayNo)'}>}SalesAmount)> sum( {<FYea

its_anandrjs

Put Equals symbol before the variable name and with different expression as well as try

count({<StoreNo={"=sum( {<DayNo={"<=$(=vYesterday_DayNo)"}>}SalesAmount)> sum( {<FYea

Or

count({<StoreNo={"=sum( {<DayNo={'<=$(=vYesterday_DayNo)'}>}SalesAmount)> sum( {<FYea

Anil_Babu_Samineni

If you create variables in script. you have to define = sign of before to the variable in set operator

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful