Skip to main content
Announcements
NEW: Seamless Public Data Sharing with Qlik's New Anonymous Access Capability: TELL ME MORE!
cancel
Showing results for 
Search instead for 
Did you mean: 
venkanna_info
Partner - Contributor
Partner - Contributor

QTD rule issue (working for 2016,2017 but not for 2018 data)

Hi All,

I am looking for the rule as below.

If we are in Jan, we need to see Jan sales and Jan + Feb + Mar Sales Goals when QTD is selected;

If we are in February, we need to see Jan + Feb sales and Jan + Feb + Mar Sales Goals when QTD is selected;

If we are in March, we need to see Jan + Feb + Mar Sales and Jan + Feb + Mar Sales Goals when QTD is selected.

I have a data for 2016,2017,2018.QTD rule is working fine for 2016 and 2017 data,but when i check data for 2018( i have data for 2018 till Apr) not working(Ex: when i select Jan,its showing QTD-Mar,but when i select Feb ,it is showing QTD-Apr and When i select Apr ,it is showing QTD- Apr).

Initially i want to correct QTD rule for 2018 data and after that i want sales to be displayed like below mentioned.

Expected output :

When i select Period : Jan and QTD ,output will show only Jan sales

When i select Period :Feb and QTD,output will show Jan+Feb Sales

When i select Period :Mar and QTD,output will show Jan+Feb+Mar Sales

Kindly need your suggestions at the earliest,it is very urgent to me.

Kindly help me.

11 Replies
duncanblaine
Creator
Creator

Without seeing your QVW is quite difficult to diagnose.
Could there be a problem in your Master Calendar calculation for QTD? Is there possibly a hard-coded value or the calendar doesn't extend past March due it using a Max value eg Max(InvoiceDate).

venkanna_info
Partner - Contributor
Partner - Contributor
Author

Hi Duncan,

Thanks for the response.

I am looking for  :  I have a field : Period ( having 12 months Jan - Dec)) and QTD( for QTD,rule written in the script).Now QTD concept is working fine.


My only concern ,how to write logic to generate below concept.


Ex1:When i select Jan (from Period field) and QTD,i want to see the sales only for Jan not upto Mar.

Ex2 :When i select Feb and QTD ,i want to see the sales for Jan+Feb only ,now i am getting upto Mar.

(Because Feb will come under Q1,it is taking Quarter end as a default.)


can you please suggest how to implement these logic.

duncanblaine
Creator
Creator

Hi Venkanna

I think I understand now!

I've attached a sample app that demonstrates the solution.

Basically you're trying to show data from all Periods in the selection (QTD) that are LESS THAN OR EQUAL to the current selected Period.

I found it easiest to use a number for the period, so that you can use the comparative analysis. This can easily be mapped to your text Period. ie. Month numbers 1 - 12.

The main thing to make this work is the Set Analysis in your Expression:

Count({<Period,PeriodNum={'<=$(=Max(PeriodNum))'}>}InvoiceNumber)

My example contains Invoices and InvoiceDates to demonstrate the logic, but you can swap that for whatever you need.
Hope this helps.

QTDIssueScreenshot.PNG

duncanblaine
Creator
Creator

Hi Venkanna
I just wanted to mention that the Expression will show all data across all Periods up to and including the current selection even if no Quarter (QTD) is selected - which might be useful.
Hope you find this helpful.

venkanna_info
Partner - Contributor
Partner - Contributor
Author

Hi Blaine,

Thanks for your time and explanation.

i have understood above expression but i am not able to sync with my current logic.

below is my current logic :

RangeSum (

If (Dimensionality () = 1

(

Sum ({$<Period_Type = {'$(=v_Periodo_Daily)'}, Period = {'$(v_Periodo_Seleção_Daily)'}, Origin = {'Direct Sales'}>} DirectSales.$(=_Metrica_Sufix))

+

Sum ({$<Period_Type = {'$(=v_Periodo_Daily)'}, Period = {'$(v_Periodo_Seleção_Daily)'}, Origin = {'Daily'},_Period_Tipe_Daily=>} Daily.$(=_Metrica_Sufix))

)

Variable Names:

v_Periodo_Daily = _Period_Tipe_Daily(Direct Field)

v_Periodo_Seleção_Daily =

=If (_Period_Tipe_Daily = 'QTD',

MaxString ({$<Period=, Period_Type = {'QTD'}, PER.ID = P(PER.ID)>} Period),

Only (Period)

)

Kindly help me with the same.

venkanna_info
Partner - Contributor
Partner - Contributor
Author

Can you please send sample application.attachment missing

duncanblaine
Creator
Creator

If you had such specific requirements, then it really would have helped if you'd shared more information in the first place. A sample app AND sample data set would be a good start.

You could try the following (in red), but its just a guess:

RangeSum (

If (Dimensionality () = 1

(

Sum ({$<Period_Type = {'$(=v_Periodo_Daily)'}, Period = {'<=$(v_Periodo_Seleção_Daily)'}, Origin = {'Direct Sales'}>} DirectSales.$(=_Metrica_Sufix))

+

Sum ({$<Period_Type = {'$(=v_Periodo_Daily)'}, Period = {'<=$(v_Periodo_Seleção_Daily)'}, Origin = {'Daily'},_Period_Tipe_Daily=>} Daily.$(=_Metrica_Sufix))

)

venkanna_info
Partner - Contributor
Partner - Contributor
Author

Hi ,

I tried using above logic,its not working.Can you check once again help on the same.

venkanna_info
Partner - Contributor
Partner - Contributor
Author

The output of the $(v_Periodo_Seleção_Daily) is mar 2018.if i apply <= ,it is taking .

Could you please suggest?