Skip to main content
Announcements
Introducing Qlik Answers: A plug-and-play, Generative AI powered RAG solution. READ ALL ABOUT IT!
cancel
Showing results for 
Search instead for 
Did you mean: 
Subashchandra_28
Partner - Contributor
Partner - Contributor

Tableau to Qlik sense migration

Hi Guys,

I'm migrating the report from Tableau to Qlik sense but I'm facing the issue while converting the below code to Qlik.

Below code is the measure which is used in the line chart and dimension is Month_Year

Target_line=WINDOW_SUM(IF FIRST()=0 THEN WINDOW_AVG([Customer_Percentage],0,14) END)

In the Above formula, They are finding the average of First 15 values and showing the same average value to all over the months.

Here customer_percentage is a measure i.e COUNTD(IF [Flag] = 'Y' THEN [Customer Id] END)*100/COUNTD([Customer Id])

Can you please Help me Here.

Thanks in advance,

Labels (7)
6 Replies
ajaykakkar93
Specialist III
Specialist III

Hi,

looping "Prashant Sangle" @PrashantSangle .

Please mark the correct replies as Solution. Regards, ARK
Profile| GitHub|YouTube|Extension|Mashup|Qlik API|Qlik NPrinting

Tanish
Partner - Creator
Partner - Creator

Hi @Subashchandra_28 ,

1. I didn't get exactly what you want in the issue. What do you mean by first 15 values? is it first 15 days of the month. If you can explain it better it would be helpful

2. For the Second issue, you can use this -

(Count ({<Flag = {'Y'}>}Distinct [Customer Id]) * 100 )/ Count (Distinct [Customer Id])

 

Thanks,

Tanish Rathore 

 

Subashchandra_28
Partner - Contributor
Partner - Contributor
Author

Hi Tanish,

Thanks for your response

I want to calculate the first 15months average and show the same average value to across all months.

For example:

if first 15 months average is 25 then that 25 value is showing to all months as target line.

Here I need to find the average value to a  measure .Below is the measure

customer_percentage= (Count ({<Flag = {'Y'}>}Distinct [Customer Id]) * 100 )/ Count (Distinct [Customer Id])

 

PrashantSangle

Try below code

RangeSum(
Above(
If(
RowNo() = 0,
RangeAvg(Total Customer_Percentage),
null()
),
0,
14
)
)

 

If you are doing bulk migration of Tableau to Qlik then Let me know. We have our product which can help you to achieve this.

 

Regards,

Prashant Sangle

Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂
Subashchandra_28
Partner - Contributor
Partner - Contributor
Author

Hi Prashant,

Thank you for your response,

Above mentioned logic is not working. As it showing error. The combination Total and RangeAvg is not possible it seems.

I have modified the logic like below . It showing every month a different average values but I want to show first month average value to all over the months

RangeAvg(below( Rangesum(aggr([Customer_Percentage], Month_Year)), 0, 14))

 

Can you please help me here

 

 

Steve_Martin
Contributor III
Contributor III

Hello @Subashchandra_28,

It would be really helpful to Qlik devs if you explained how your calc actually works, and crucially, the range in question.

Tableau Window calcs are highly scoped just to the data in the physical window - the data pane, rather than the data set in its entirety for example, if your data covers the last 20 years, but your view displays the last 3 months, the window calc will only operate on the last 3 months of data, and, window calcs are a last-step, they are affected by filters.

Finally, your calc is telling Tableau to place the output onto the first row in your range - First() just like Index() and Last() are all incrementing row counters although First() and Last() are base-zero. Tableau benefits from allowing us to set the scope direction, and partitioning - its virtually the same as an SQL advanced aggregation eg:

Sum(sales) Over (Partition By region, category Order By order_date desc) 

So I'm guessing you won't want to show the fortnightly data so you're probably using a late-filter scoped to the beginning of each range, setup as boolean something like:
Index() = 1

I'm not so sure that Qlik can easily do this, but to the other devs on this chat, does this explanation help you?

Steve_Martin_0-1699393754773.png

Steve