Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
kiru_18
Contributor II
Contributor II

Sum with Set expression issues

Hi,

I'm having 2 tables. One is master_calendar. Another is Fact table - Sales.

FIELDS IN TABLES

Master calendar = DATE, DAY, MONTH, YEAR, YEARMONTH, PREVIOUS7DAYFLAG.

Fact table Sales = SOURCE, DATE, CUSTOMER, REGION, SALES

DATE is the field which connects Fact & Master Calendar Table

In script PREVIOUS7DAYFLAG IS WRITTEN AS: If(%Date >= (Today()-7) and %Date < Today(), 1, 0) as PREVIOUS7DAYFLAG

SOURCE Field consist of data: Ordered , Invoiced

Requirement: Need to calculate Sum of Source - Ordered for last 7 days.

I tried with set expression : Sum({<Source={'Ordered'},Previous7DaysFlag={'1'}>}Sales). This is not working. Kindly help me to find out the correct expression.

 

Labels (3)
1 Reply
Maheshwar
Contributor II
Contributor II

Hi,

Make sure the formats of both dates i.e Date field in your table and Today() field should be in same formats and the expression you mentioned should work.