Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Discover how organizations are unlocking new revenue streams: Watch here
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

What if...?

Hi all

Im working on a qlikview model but a customer asked me to create a what if analysis using a slider object and a table containing x,y,z

any ideas how to go about doing that?

1 Solution

Accepted Solutions
suniljain
Master
Master

Pls Check attached Doc.

It will Help You.

[View:http://community.qlik.com/cfs-file.ashx/__key/CommunityServer.Discussions.Components.Files/11/8182.What-If-analysis.doc:550:0]

View solution in original post

25 Replies
Not applicable
Author

Hi ,

Plz give details of what this table is all about, criteria, table content etc.

Happy Thoughts

Not applicable
Author

alright....i got a list of Customers alright. They all got sales, cost, gross profit and gross profit %.

Now i need the create several or if possible just one slider object that depicts certain criteria. e.g

If the sales increase by 10% but the costs increase by 7% what will the outcome be.(How will the GP and GP% change)

The straight table needs to be used to give the outcome by each customer.

let me know if you understand.

I cnt seem to get it right.

Not applicable
Author

Hi Blaze,

First thing to do is to create 2 sliders, one for Sales and one for Cost. Then, assign a variable for both like v_Sales for sales slider and v_Cost for cost slider. Next, assign a Min Value, Max Value and Static Step for your slider. Try to use -10 for Min Value, 30 for Max Value and 1 for Static Step. In this case, your slider would be from -10 (negative ten) to 30 with a step of 1. After doing that, create a straight table with a Customer dimension and expressions for sales, cost, gross profit and gp%.

Now create an expression for your "What-If Sales" the formula would be for example:

sum (SALES) * (1 + v_Sales/100)


And for "What-If Cost:

sum (COST) * (1 + v_Cost/100)


And for Gross Profit (that is Sales less the Cost, right?.. then):

sum (SALES) * (1 + v_Sales/100) - sum (COST) * (1 + v_Cost/100)


so therefore, GP% is:

sum (SALES) * (1 + v_Sales/100) / sum (COST) * (1 + v_Cost/100)
- change the number format to percentage..

And TADA!! Now you got your What-If analysis..

Hope that help you solve your problem..

-Lester

Not applicable
Author

well it does work, but now the rest of my data is messed up lol all f my graphs say theres no data etc.

Whats happening?

Not applicable
Author

hmmm.. that's weird.. coz we didn't change any of your data.. Hmm

Not applicable
Author

i know... Indifferent but half the data gone even after i delete the what if

Not applicable
Author

actually, the "what-if' has nothing to do with your other graphs or charts.. try to check your script, you might have accidentally changed your script and reloaded it..

- Lester

Not applicable
Author

if i insert the what if analysis then nothing changes okay, but once i move the slider than all my data on every sheet changes and i cnt reset it using clear or anything. my script seems fine i haven't touched it

Not applicable
Author

any Ideas?