Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Based on below data, i need to develop two measures:
- to count distinct transactions "Tx_ID" which its "Tx_UPDATE_DATE" month/year equal to "User_CreateDate" month/year, and it's amount not equal 0.
- to count distinct transactions "Tx_ID" which its "Tx_UPDATE_DATE" month/year after "User_CreateDate" month/year, and it's amount not equal 0.
Note: the dimension will be "month/year".
In ur script, in the table where u have these fields; create a FLAG
if(Tx_Amount>0
and Year(Tx_UPDATE_DATE) = Year(User_CreateDate)
and Month(Tx_UPDATE_DATE) = Month(User_CreateDate), 'Measure1',
if(
Tx_Amount>0
and Tx_UPDATE_DATE>User_CreateDate
and Month(Tx_UPDATE_DATE) <> Month(User_CreateDate), 'Measure2'
)) as FLAG,
Now :
to count distinct transactions "Tx_ID" which its "Tx_UPDATE_DATE" month/year equal to "User_CreateDate" month/year, and it's amount not equal 0:
count(distinct {<FLAG={'Measure1'}>}Tx_ID)
- to count distinct transactions "Tx_ID" which its "Tx_UPDATE_DATE" month/year after "User_CreateDate" month/year, and it's amount not equal 0.
count(distinct {<FLAG={'Measure2'}>}Tx_ID)